<?


class ViewHtml extends ViewBase 
{
	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	array
	 */
	public function ViewHtml()
	{
		$this->ViewBase(__CLASS__) ;
		$this->Initialize() ;
	}


	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	string
	 */
	public function GetDialogTitle()
	{
		return JCAT_Language::Sentence('HTML 视图') ;
	}
	
	
	/**
	 * 初始化相关的 MVC 对象
	 * 
	 * @access	public
	 * @return	void
	 */
	public function Initialize()
	{
		// 消息队列
		$aMessageQueue = new JCAT_MessageQueue() ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,MSGMVC) ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,MSGMVC_OK) ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,MSGMVC_BAD) ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,MSGMVC_DEBUG) ;
		$this->SetMessageQueue($aMessageQueue) ;
		
		// 消息输出器
		JCAT_Package::ImportClass('JCAT_MessageGtkDialogPrinter',JCAT::PACKAGE_MSG) ;
		$aMessageQueuePrinter = new JCAT_MessageGtkDialogPrinter($aMessageQueue) ;
		$aMessageQueue->AddPrinter($aMessageQueuePrinter) ;

		// 文档
		$aDoc = new ViewHtmlDoc() ;
		$this->AddDocument($aDoc,'MainDoc') ;

		// 主视图
		$aView = new ViewHtmlDlg($this) ;
		JCAT_View::RegisterGlobalName($aView,'MainView') ;
		$aView->SetDocument($aDoc) ;
		$this->AddView($aView) ;

		// 父类的初始化函数
		parent::Initialize($aDoc) ;
	}

	

	/**
	 * 
	 *
	 * @access	public
	 * @return	void
	 */
	public function MainRun($arrArgv=array())
	{
		// 移交给父类
		parent::MainRun(& $arrArgv) ;
		
		// 载入 所有 子控件		 
		$aSubController = $this->GetController('UICtrlContainer') ;
		$aSubController->MainRun(& $arrArgv) ;
		
		// 堵塞
		$this->Waiting() ;
	}


}

?>